package cn.edu.sgu.www.mhxysy.dto.equipment;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
@Validated
public class EquipmentAttributeDTO implements DataTransferObject {

	@ApiModelProperty(value = "ID")
	private String id;

	/**
	 * 属性类型
	 */
	@Positive(message = "属性类型" + CustomMessages.ILLEGAL)
	@NotNull(message = "属性类型" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "属性类型", required = true)
	private Integer type;

	/**
	 * 装备ID
	 */
	@Pattern(regexp = RegExps.EQUIPMENT_ID, message = "角色ID" + CustomMessages.ILLEGAL)
	@NotBlank(message = CustomMessages.EQUIPMENT_ID_NOT_NULL)
	@ApiModelProperty(value = "装备ID", required = true)
	private String equipmentId;

	/**
	 * 属性ID
	 */
	@Positive(message = "属性ID" + CustomMessages.ILLEGAL)
	@NotNull(message = "属性" + CustomMessages.ID_NOT_NULL)
	@ApiModelProperty(value = "属性ID", required = true)
	private Integer propertyId;

	/**
	 * 属性值
	 */
	@Positive(message = "属性值" + CustomMessages.ILLEGAL)
	@NotNull(message = "属性值" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "属性值", required = true)
	private Integer propertyValue;
}